<template>
  <div>
    <vol-box
      :lazy="true"
       v-model="dialogVisible"
      title="文档下载"
      :height="500"
      :width="1200"
      :padding="1"
      :draggable="true"
    >
      <div>
        <vol-form ref="form"
            :labelWidth="80"
            :load-key="true"
            :formFields="fields"
            :formRules="formOptions">
  </vol-form>
      </div>

      <template #footer>
        <div>
          <el-button type="default" size="mini" @click="dialogVisible = false"
            >关闭</el-button
          >
        </div></template
      >
    </vol-box>
  </div>
</template>
<script>
import VolBox from "@/components/basic/VolBox.vue";
import VolForm from "@/components/basic/VolForm.vue";
import abc from "@/uitils/h_common.js"; //这是默认的写法

export default {
  components: { VolBox, abc,VolForm },
  data() {
    return {
      dialogVisible: false,
      isshow1: true,
       fields: {"classID":[],"sortPath":"","title":"","titleColor":"","titleURL":"","attachmentURL":"","content":"","att_address":"tt"}, 
       formOptions: [[{"dataKey":"下载分类","data":[],"title":"分类","required":true,"field":"classID","type":"cascader",'disabled':true}],
                              [{"title":"标题","field":"title",'disabled':true},
                              ],
                       
                              [{"title":"附件","field":"attachmentURL","type":"file","readonly":true
                              },],
                              [{"title":"下载地址","field":"att_address","readonly":true,
                              },],
                              [{"title":"内容","field":"content","colSize":12,"type":"editor",'disabled':true}]],
       
    };
  },
  setup() {},
  destroyed() {},
  mounted() {
    this.$nextTick(() => {
      setTimeout(() => {
        //this.fields.att_address=encodeURI(location.origin+"/"+this.fields.attachmentURL[0].path);
        //console.log(this.fields.attachmentURL[0]);
      }, 2000);
    });
  },
  methods: {
      get_fujian_path(){
        this.$nextTick(() => {
          setTimeout(() => {
            this.fields.att_address=encodeURI(this.http.ipAddress+this.fields.attachmentURL[0].path);
            console.log(this.fields.attachmentURL[0]);
          }, 1000);
       
    });
      }
  },
};
</script>